﻿
@{
    ViewBag.Title = "Index";
    var showEdit = ViewBag.IsEdit == "9" ? "display:block;" : "display:none;";
} 
<style >
    .ed_container {
        display: flex;
    }
    .ed_container a {
        margin-right: 10px;
    }
</style> 

<section class="content">
    <div class="form-horizontal">
        <div class="box box-solid">
            <div class="box-nav clearfix" style="display:none;">
                <div class="col-sm-12">
                    <button type="button" class="btn btn-primary" onclick="Select();" title="查询"><i class="fa fa-search"></i>&nbsp;&nbsp;查询</button>
                    <a class="btn btn-default" onclick="javascript: window.location.reload();" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a>
                </div>
            </div>
            <div class="box-body">
                <table class="footable table table-stripped table-bordered table-hover" id="footable" data-page-size="20" data-filter=#filter>
                    <thead>
                        <tr>
                            <th data-sort-ignore="true">
                                家族名称
                            </th>
                            <th data-hide="phone,tablet" data-sort-ignore="true">
                                家族简介
                            </th>
                            <th data-hide="phone,tablet" data-sort-ignore="true">
                                创建时间
                            </th>
                            <th data-sort-ignore="true">
                                查看
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @if (null != Model)
                        {
                            foreach (var item in Model)
                            {
                                <tr>
                                    <td>
                                        @item.FamilyName
                                    </td>
                                    <td>
                                        @item.Profile
                                    </td>
                                    <td>
                                        @item.CreateTime
                                    </td>
                                    <td>
                                        <div class="ed_container">
                                            <a href="javascript:void(0);" onclick="ShowModal('@item.FamilyInfoId')">族谱</a>                                            
                                            <a style="@showEdit" href="javascript:void(0);" onclick="EditModal('@item.FamilyInfoId')">编辑</a>
                                        </div>
                                    </td>
                                </tr>
                            }
                        }
                    </tbody>
                   
                </table>
            </div>
        </div>
    </div>
</section>

<script type="text/javascript">
     function ShowModal(fid) {
         url = '@Url.Action("index2", "FamilyInfo")';
         window.location.href = url + '?fid=' + fid;
            //window.location.href = url + '?edit=9&fid=' + $('#FamilyInfoId').val();
     }

    function EditModal(fid) {
         url = '@Url.Action("EFamily", "FamilyInfo")';
        window.location.href = url + '?type=e&fid=' + fid;
            //window.location.href = url + '?edit=9&fid=' + $('#FamilyInfoId').val();
     }

</script> 